package com.ad.pet.app.main.adapter;

import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ad.pet.R;
import com.ad.pet.common.data.utils.glide.GlideUtil;
import com.ad.pet.models.remote.home.HomeMall;

import java.util.List;

/**
 * Created by SEELE on 2019/7/5.
 */

public class NewUserMallAdapter extends BaseQuickAdapter<HomeMall,BaseViewHolder>{
    String moneySybel;
    public NewUserMallAdapter(@Nullable List<HomeMall> data,String moneySysmle) {
        super(R.layout.item_new_user_mall_layout);
        this.moneySybel = moneySysmle;
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeMall item) {

        TextView tvPrice = helper.getView(R.id.tv_price);
        TextView tvOldPrice = helper.getView(R.id.tv_old_price);
        ImageView ivHead = helper.getView(R.id.iv_pic);
        TextView tvTitle = helper.getView(R.id.tv_title_name);

        GlideUtil.load(mContext,item.getImage(),ivHead);
        tvOldPrice.setText(moneySybel+item.getOrig_price());
        tvPrice.setText(moneySybel+item.getPrice());
        tvTitle.setText(item.getName());

        tvOldPrice.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG);
    }


    public void setMoneySybel(String moneySybel) {
        this.moneySybel = moneySybel;
    }
}
